<?php
namespace tjsd\mappers;

/**
 * Index that finds path to class file containing class defined by namespace path.
 * 
 * This index is used to find class file by ClassLoader, asuming that class namespace copy
 * directory structure.
 * 
 * @see tjsd\system\enviroment\ClassLoader
 * @author Jakub Tesárek <info@tjsd.cz>
 * @copyright 2012
 * @version 1.0
 */
class ClassNamespaceIndex extends \tjsd\core\Object implements Index {
	
	/**
	 * Creates new class namespace index 
	 */
	public function __construct() {}
	
	/**
	 * Finds class file by given namespace
	 * 
	 * @param array $path	array containing namespace splited by namespaces delimiter
	 * @return string			path to file with class definition	
	 */
	public function find(array $path) {
		return implode(DIRECTORY_SEPARATOR, $path) . '.php';
	}
}